import UserInfo from "@/vo/UserInfo";
import {sessionUtl} from "@/utils/sessionUtl";

export default {
    namespaced: true,
    state: {
        // 用户信息
        userInfo: sessionUtl.get('userInfo') || new UserInfo(),
    },
    actions: {},
    mutations: {
        /**
         *设置全局userInfo
         * @param state
         * @param userInfo
         */
        setUserInfo(state: any, userInfo: UserInfo) {
            sessionUtl.save('userInfo', userInfo);
            state.userInfo = userInfo;
        }
    },
};